package com.iwhalecloud.bss.kite.cucc.service.pos.bcmc;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.iwhalecloud.bss.kite.common.chain.IRequest;
import com.iwhalecloud.bss.kite.cucc.client.dto.cust.CuccContextCustDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosDTO;
import com.iwhalecloud.bss.kite.cucc.client.dto.pos.KitePosGoodsDTO;
import com.iwhalecloud.bss.kite.service.ord.pos.handler.KitePosSceneBO;

/**
 * <Description> <br>
 * Bcmc报文封装上下文
 * 
 * @author XXZ<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2020年12月15日 <br>
 * @since R9.0<br>
 * @see com.iwhalecloud.bss.kite.cucc.service.pos.bcmc <br>
 */
public class BcmcPosContext implements IRequest {

    /**
     * serialVersionUID <br>
     */
    private static final long serialVersionUID = -6122169866289074831L;

    private String sceneInstId;

    private String custId;

    private String staffId;

    private String orgId;

    private String lanId;

    private Boolean checkAccountModule;

    private Boolean checkContractModule;

    private KitePosSceneBO posSceneBO;

    protected CuccContextCustDTO custDto;

    protected KitePosDTO posDto = new KitePosDTO();

    // 是否归属BCMC流程,true表示是，false表示否
    private Boolean isBcmcFlow;

    public String getSceneInstId() {
        return sceneInstId;
    }

    public void setSceneInstId(String sceneInstId) {
        this.sceneInstId = sceneInstId;
    }

    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    public String getStaffId() {
        return staffId;
    }

    public void setStaffId(String staffId) {
        this.staffId = staffId;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getLanId() {
        return lanId;
    }

    public void setLanId(String lanId) {
        this.lanId = lanId;
    }

    public KitePosSceneBO getPosSceneBO() {
        return posSceneBO;
    }

    public void setPosSceneBO(KitePosSceneBO posSceneBO) {
        this.posSceneBO = posSceneBO;
    }

    public CuccContextCustDTO getCustDto() {
        return custDto;
    }

    public void setCustDto(CuccContextCustDTO custDto) {
        this.custDto = custDto;
    }

    public Boolean getCheckAccountModule() {
        return checkAccountModule;
    }

    public void setCheckAccountModule(Boolean checkAccountModule) {
        this.checkAccountModule = checkAccountModule;
    }

    public Boolean getCheckContractModule() {
        return checkContractModule;
    }

    public void setCheckContractModule(Boolean checkContractModule) {
        this.checkContractModule = checkContractModule;
    }

    public KitePosDTO getPosDto() {
        if (Objects.isNull(posDto)) {
            posDto = new KitePosDTO();
        }
        return posDto;
    }

    public void setPosDto(KitePosDTO posDto) {
        this.posDto = posDto;
    }

    public void addGoods(KitePosGoodsDTO goods) {
        List<KitePosGoodsDTO> goodsList = this.posDto.getGoods();
        if (goodsList == null) {
            goodsList = new ArrayList<>();
        }
        goodsList.add(goods);
        this.posDto.setGoods(goodsList);
    }

    public Boolean getIsBcmcFlow() {
        return isBcmcFlow;
    }

    public void setIsBcmcFlow(Boolean isBcmcFlow) {
        this.isBcmcFlow = isBcmcFlow;
    }
}
